<?php
namespace app\common\model;

use think\Db;
use think\Model;
/**
 * 订单日志 
 */

class OrderLogModel extends Model
{
    protected $name='orders_log';
    // 列表查询
    public function getAll($where, $join=array(), $page=1, $pageSize=10, $field='*', $order)
    {
        $result = $this->where($where)
                    ->join($join)
                    ->field($field)
                    ->page($page, $pageSize)
                    ->order($order)
                    ->select();
        return $result;
    }

    // 数量查询
    public function getCount($where, $join)
    {
        $result = $this->where($where)
                    ->join($join)
                    ->count();
        return $result;
    }

    // 单个查询
    public function getOne($where, $join, $field)
    {
        $result = $this->where($where)
                    ->join($join)
                    ->field($field)
                    ->find();
        return $result;
    }
     /**
     * @desc   添加
     * @param  无
     * @date   2018-08-15
     * @author lcx
     * @param  [type]     $data [description]
     * @return [type]           [description]
     */
    public function add($data)
    {
        return $this->insertGetId($data);
    }   

}